//
//  JlServeceViewController.m
//  YaDiuDiu
//
//  Created by 欧洪飞 on 2017/10/23.
//  Copyright © 2017年 jy. All rights reserved.
//

#import "JlServeceViewController.h"

@interface JlServeceViewController ()

@property (nonatomic,copy)NSString *content;

@end

@implementation JlServeceViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setBGColor];
    [self showNav:@"协议"];
    //
    [self loadData];
}

- (void)loadUI{
    UIWebView *web = [[UIWebView alloc] initWithFrame:CGRectMake(0, 64, ScreenWidth, ScreenHeight-64)];
    //加载html文本
    [web loadHTMLString:_content baseURL:nil];
    [self.view addSubview:web];
}

- (void)loadData{
    NSString *url = [NSString stringWithFormat:@"%@/App/Agreement/resume",urlHead];
    [[AFHTTPSessionManager manager] POST:url parameters:nil success:^(NSURLSessionDataTask *task, id responseObject) {
        NSLog(@"简历协议res:%@",responseObject);
        _content = [[responseObject objectForKey:@"result"] objectForKey:@"content"];
        [self loadUI];
    } failure:^(NSURLSessionDataTask *task, NSError *error) {
        NSLog(@"error:%@",error);
    }];
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
